<ui:composition template="template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<h:head>
	</h:head>
	
	<ui:define name="gestionClientes">
		<h:form>		                
		    <p:growl id="growl" />
		    <p:dataTable id="dataTable" var="cli" value="#{clienteBean.clientesModel}" paginator="true" rows="10">
		        <f:facet name="header">
		           Lista de Clientes
		        </f:facet>		
		        <p:column>
		            <f:facet name="header">
		                <h:outputText value="Nombre Completo" />
		            </f:facet>
		            <h:outputText value="#{cli.nomCompleto}}" />
		        </p:column>		        
		        <p:column>
		            <f:facet name="header">
		                <h:outputText value="eMail" />
		            </f:facet>
		            <h:outputText value="#{cli.mail}" />
		        </p:column>
				<p:column>
				<p:commandButton value="Modificar" action="#{clienteBean.buscarCliente}">
        		<f:setPropertyActionListener target="#{clienteBean.clienteBuscar}" value="#{cli.mail}" />            
    			</p:commandButton>
    			</p:column>
				<p:column>
				<p:commandButton value="Eliminar" action="#{clienteBean.getEliminarCliente}" update="dataTable">
        		<f:setPropertyActionListener target="#{clienteBean.cliEliminar}" value="#{cli.mail}" />            
    			</p:commandButton>
				</p:column>	
		    </p:dataTable>
		
		    <p:blockUI block="dataTable" trigger="dataTable">
		        LOADING<br />
		        <p:graphicImage value="/images/delete.png"/>
		    </p:blockUI>
		</h:form>
		                    
	</ui:define>
</ui:composition>

